<?php


namespace app\api\validate;


class IDCollection extends BaseValidate
{
    protected $rule =[
        'ids' => 'require|checkIDs'
    ];

    protected $message = [
        'ids'=>'ids参数必须为逗号分隔的正整数'
    ];

    protected  function checkIDs($values){
        $values = explode(',',$values);
        foreach ($values as $id){
            if(!$this->isPostiveInt($id)){
                return false;
            }
        }
        return true;
    }
}